package net.btd.city;

import java.io.*;

public class DomainDatas
{

    public short _fldfor;
    public short _fldint;
    public short _fldbyte;
    public short _fldif;
    public short _fldnew;
    public String _flddo[];
    public String _fldcase[];
    private static DomainDatas _fldtry = null;
    private byte a;

    public DomainDatas()
    {
        _fldfor = 0;
        _fldint = 0;
        _fldbyte = 0;
        _fldif = 0;
        _fldnew = 0;
        _flddo = null;
        _fldcase = null;
        a = -1;
    }

    public static DomainDatas _mthif()
    {
        if(_fldtry == null)
            _fldtry = new DomainDatas();
        if(_fldtry.a != BTDMIDlet._fldint)
        {
            _fldtry.a();
            _fldtry.a = BTDMIDlet._fldint;
        }
        return _fldtry;
    }

    public String _mthif(int i)
    {
        if(i < 0 || i >= _flddo.length)
            return "";
        else
            return _flddo[i];
    }

    public String a(int i)
    {
        if(i < 0 || i >= _fldcase.length)
            return "";
        else
            return _fldcase[i];
    }

    public void a()
    {
label0:
        {
            try
            {
                InputStream inputstream = getClass().getResourceAsStream("./data/" + CFG._fldcase[BTDMIDlet._fldint] + "dm.txt");
                if(inputstream == null)
                    System.out.println("ERROR: domain file not exits " + CFG._fldcase[BTDMIDlet._fldint]);
                DataInputStream datainputstream = new DataInputStream(inputstream);
                _fldfor = datainputstream.readShort();
                _fldint = datainputstream.readShort();
                _fldbyte = datainputstream.readShort();
                _fldif = datainputstream.readShort();
                _fldnew = datainputstream.readShort();
                _flddo = new String[datainputstream.readByte()];
                for(int i = 0; i < _flddo.length; i++)
                    _flddo[i] = datainputstream.readUTF();

                _fldcase = new String[datainputstream.readByte()];
                for(int j = 0; j < _fldcase.length; j++)
                    _fldcase[j] = datainputstream.readUTF();

            }
            catch(Exception ex)
            {
                System.gc();
                ex.printStackTrace();
                break label0;
            }
            finally
            {
                System.gc();

            }
            System.gc();
            break label0;
        }
    }

}
